class Change:

    def __init__(self, f, t):
        self.f = f
        self.t = t

py_change = Change('python3.6', 'python3.8.6')
import os
for i in os.listdir():
    if os.path.isdir(i):
        for j in os.listdir(i):
            if j.endswith(".py"):
                with open(f"{i}/{j}", "r", -1, "utf-8") as f:
                    try:
                        s = f.read()
                    except:
                        ff = open(f"{i}/{j}", "r")
                        s = f.read()
                        ff.close()
                    s = s.replace(py_change.f, py_change.t)
                    name = j.split(".")[0]
                    with open(f"{i}/{name}.py", "w", -1, "utf-8") as f1:
                        f1.write(s)
